package github.flandre.examplemod.common.entity.render;

import github.flandre.examplemod.common.entity.ExampleEntity;
import github.flandre.examplemod.common.entity.model.ExampleEntityModel;
import github.flandre.examplemod.examplemod;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.util.ResourceLocation;

public class ExampleEntityRender extends MobRenderer<ExampleEntity, ExampleEntityModel> {
    private static final ResourceLocation EXAMPLE_TEXTURLS_1 =
            new ResourceLocation(examplemod.MODID,"textures/entity/example_entity_1.png");
    private static final ResourceLocation EXAMPLE_TEXTURLS_2 =
            new ResourceLocation(examplemod.MODID,"textures/entity/example_entity_2.png");
    private static final ResourceLocation EXAMPLE_TEXTURLS_3 =
            new ResourceLocation(examplemod.MODID,"textures/entity/example_entity_3.png");

    public ExampleEntityRender(EntityRendererManager renderManagerIn) {
        //super(renderManagerIn, entityModelIn, shadowSizeIn);
        // 渲染代理 模型 影子大小
        super(renderManagerIn, new ExampleEntityModel(), 0.8f);
    }

    @Override //获得实体贴图
    public ResourceLocation getEntityTexture(ExampleEntity entity) {
        //需要返回一个实体贴图
        Byte color = entity.getCOLOR();
        if(color == 2)
            return EXAMPLE_TEXTURLS_3;
        else if(color == 1)
            return EXAMPLE_TEXTURLS_2;
        else
            return EXAMPLE_TEXTURLS_1;
    }
}
